<template>
	<view>
		<view>我是list页面</view>
		<view v-for="(item, index) in list" :key="index">{{ item }}</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			list: [] //城市列表
		};
	},
	onLoad() {
		//发送网络请求
		// #ifdef H5
			var url = '/api/list';
		// #endif
		
		// #ifndef H5
			var url = "http://localhost:3000/api/list";
		// #endif

		uni.request({
			url: url,
			method: 'GET',
			success: res => {
				// console.log(res)
				this.list = res.data;
			},
			fail: err => {
				console.log(err);
			}
		});
	},
	methods: {}
};
</script>

<style></style>
